import request from "./request"



export const loginPass = (account:string,password:string)=>{
    return request.post<any,loginUsers>("/pro/login",{account,password})
}

// 发送验证码
export function sentYzm(phone: string) {
    return request.get<any, YzmTypes>('http://120.26.90.83:3000/captcha/sent', {
        params: {
            phone
        }
    })
}


// 验证验证码
export function YZYzm(phone: string, captcha: string) {
    return request.get<any, YzmTypes>("http://120.26.90.83:3000/captcha/verify", {
        params: {
            phone,
            captcha
        }
    })
}


// 手机号获取token
export function getToken(phone:string){
    return request.post<any,tokenType>('/pro/gettoken',{
        phone
    })
}

// 获取用户信息
export function getUserInfoData(){
    return request.get <any,axiosType<foundUserType>>("pro/getuserinfo")
}

// 修改密码
export const setpassApi = (oldpass:string,newpass:string)=>{
    return request.post<any,axiosType<setpasstypes>>("/pro/resetpass",{oldpass,newpass})
}

// 文件上传
export const updateDataApi = (data:FormData)=>{
    return request.post<any,imgType>("/pro/uplodafile",data)
}
// 修改头像
export function changeUserInfo(avatar:string){
    return request.post<any,chnageimg>('/pro/changeuserinfo',{avatar})
}
